class User < ActiveRecord::Base
  attr_accessible :name

  def getRating()
    rating = 0
   Sound.where(:userid => self.id.to_s).each do |sound|
     rating  = sound.rating + rating
    end
   return rating
  end

  def getCount()
    count = 0
   Sound.where(:userid => self.id.to_s).each do |sound|
     count = count + 1
    end
   if count==0 
     return "no sounds yet"
   else
    return count
   end
  end
end
